import csv

with open('./cccsssvvv.csv', 'w', encoding='utf-8') as f:
    w = csv.writer(f)
    w.writerow(['name', 'age'])
    w.writerow([('python', '18'), ('python', '19'), ('python', '20')])  # 一行写入
    w.writerows([('python', '18'), ('python', '19'), ('python', '20')])  # 多行写入

with open('./cccsssvvv2.csv', 'w', encoding='utf-8') as f:
    w = csv.DictWriter(f, fieldnames=['name', 'age', 'height'])
    w.writeheader()
    for i in range(1, 6):
        w.writerows([{'name': 'python' + str(i), 'age': '18' + str(i), 'height': 140}])


